<?php
/**
 * Created By PhpStorm
 * Author: patrick wu
 * Date: 2020/11/5
 * Time: 15:49
 */
namespace App\Http\Model\Mysql;

use Illuminate\Database\Eloquent\Model;

class ProductCommissionModel extends Model
{
    const IS_DELETE     =   1,      //已删除
        NOT_DELETE      =   0;      //未删除

    const IS_DEFAULT    =   1,      //默认
        NOT_DEFAULT     =   0;      //非默认

    const IS_COMMISSION =   1,      //分佣
        NOT_COMMISSION  =   0;      //不分佣

    protected $table    =   'mini_product_commission';

    protected $guarded  =   [];

    protected $dateFormat   =   'U';

    /**
     * 定义连接产品表
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function good()
    {
        return $this->hasOne(ProductModel::class, 'id', 'product_id');
    }

}
